package com.wlz.embedded;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.util.CharsetUtil;

/**
 * 本地测试模式  用来测试handler的执行  就不需要完整的实现客户端或者服务端
 */
public class Embedded {
    public static void main(String[] args) {
        ByteBuf byteBuf= Unpooled.copiedBuffer("hello netty", CharsetUtil.UTF_8);
        EmbeddedChannel embeddedChannel=new EmbeddedChannel(new NettyClientHandler());
        embeddedChannel.writeInbound(byteBuf);
    }
}
